<%#
kind: iPXE
name: Windows default iPXE httpboot
model: ProvisioningTemplate
oses:
- Windows
description: |
  The template to render iPXE installation script for Windows
  The output is deployed on the host's subnet TFTP proxy.
  See https://ipxe.org/scripting for more details
-%>
#!ipxe

set boot-url http://<%= foreman_request_addr %>/httpboot/
kernel ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:kernel) %>

iseq ${platform} efi && goto win_efi || goto win_legacy

:win_efi
initrd -n peSetup.cmd <%= foreman_url('script') %> peSetup.cmd
goto boot

:win_legacy
initrd <%= foreman_url('script') %> peSetup.cmd

:boot
initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bcd) %> BCD
initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootsdi) %> boot.sdi
initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootwim) %> boot.wim

boot
